import 'package:flutter_taotaoshipin/generated/json/base/json_convert_content.dart';
import 'package:flutter_taotaoshipin/model/drama_list_entity.dart';

DramaListEntity $DramaListEntityFromJson(Map<String, dynamic> json) {
  final DramaListEntity dramaListEntity = DramaListEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    dramaListEntity.id = id;
  }
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    dramaListEntity.title = title;
  }
  final int? sort = jsonConvert.convert<int>(json['sort']);
  if (sort != null) {
    dramaListEntity.sort = sort;
  }
  final String? vid = jsonConvert.convert<String>(json['vid']);
  if (vid != null) {
    dramaListEntity.vid = vid;
  }
  final int? money = jsonConvert.convert<int>(json['money']);
  if (money != null) {
    dramaListEntity.money = money;
  }
  final int? isPay = jsonConvert.convert<int>(json['is_pay']);
  if (isPay != null) {
    dramaListEntity.isPay = isPay;
  }
  final int? ctime = jsonConvert.convert<int>(json['ctime']);
  if (ctime != null) {
    dramaListEntity.ctime = ctime;
  }
  return dramaListEntity;
}

Map<String, dynamic> $DramaListEntityToJson(DramaListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['title'] = entity.title;
  data['sort'] = entity.sort;
  data['vid'] = entity.vid;
  data['money'] = entity.money;
  data['is_pay'] = entity.isPay;
  data['ctime'] = entity.ctime;
  return data;
}

extension DramaListEntityExtension on DramaListEntity {
  DramaListEntity copyWith({
    int? id,
    String? title,
    int? sort,
    String? vid,
    int? money,
    int? isPay,
    int? ctime,
  }) {
    return DramaListEntity()
      ..id = id ?? this.id
      ..title = title ?? this.title
      ..sort = sort ?? this.sort
      ..vid = vid ?? this.vid
      ..money = money ?? this.money
      ..isPay = isPay ?? this.isPay
      ..ctime = ctime ?? this.ctime;
  }
}